package net.jielan188.hd.util;

import javax.servlet.ServletContextEvent;
import java.io.File;
import javax.servlet.ServletContextListener;

public class LogbackConfigListener implements ServletContextListener {

  @Override
  public void contextInitialized( ServletContextEvent event ) {
    String path = event.getServletContext().getRealPath( "/WEB-INF/" );
    File file = new File( path,"logs" );
    if ( !file.exists() ) {
       file.mkdir();
    }
    Log.info("加载日志成功！");
  }

  @Override
  public void contextDestroyed(ServletContextEvent arg0) {

  }
}